(function($){
	$.fn.EChartsLine=function(option){
	var myChart= echarts.init(this[0], 'macarons');
			myChart.showLoading({
				text: '正在努力的读取数据中...', //loading
			});
	var  deftion={
			'text':'示例',//图表名称
			'Url':'',//图表Url地址
			'type':'',//图标类型：pie:饼状图，bar:柱状图
			'align':'center',//标题位置：居左：left,center:居中，right:居右
			"color":"#5cb85c"//区域颜色
	};
	$.extend(true,deftion, option);
	$.ajax({
		type:"get",
		url:deftion.Url,
		async:true,
		success:function(row){
		myChart.setOption({
       	 xAxis: {
            data:row.xAxis 
        },
     	series:row.series
     	
        });
		}
	});
	var option = {
				title: {
					text: deftion.text
				},
				tooltip: {
					trigger: 'axis',
					axisPointer: {
						type: 'cross',
						label: {
							backgroundColor: '#6a7985'
						}
					}
				},
				legend: {
					data: []
				},
				grid: {
					left: '3%',
					right: '4%',
					bottom: '3%',
					containLabel: true
				},
				xAxis: [{
					type: 'category',
					boundaryGap: false,
					data: []
				}],
				yAxis: [{
					type: 'value'
				}],
				series: [{
						name: '邮件营销',
						type: 'line',
						lineStyle:{
							normal: {
								color: deftion.color
							}
						},
						itemStyle:{
							normal: {
								color: deftion.color
							}
						},
						data:[] 
					}
				]
			};

			myChart.hideLoading();
			// 使用刚指定的配置项和数据显示图表。
			myChart.setOption(option);
	
	
}
})(jQuery);